
import React from "react";
import PropTypes from "prop-types"

export default class Person extends React.Component {
    constructor(props){
        super(props)
        console.log('Demo>>>props',props)
    }
    static propTypes={

    }  
    static defaultProps={

    }  
	state = {
       
    }
	render() {
        console.log('我是person组件this>>>>',this)
        const {name,sex,age} = this.props
		return (
			<div>
				<h2 >我是person组件</h2>
                <div>姓名{name}</div>
                <div>性别{sex}</div>
                <div>年龄{age}</div>
			</div>
		)
	}
    clickMyName = () =>{
        console.log('点击了')
    }
}
Person.propTypes = {
    age: PropTypes.number.isRequired
}
Person.defaultProps = {
    age:11
}